#if 0
#ifndef __UART4_H__
#define __UART4_H__
#include "stdio.h"	
#include "stm32f10x.h" 
#include "rtos.h"
#include "uartcommon.h"

#define UART4_TXBUFF_SIZE   1024
#define UART4_RXBUFF_SIZE   1024
#define UART4_RX_QUEUE_LEN  3
#define UART4_TX_INTERVAL 15    //ms
#define UART4_RX_INTERVAL 8  //ms



#ifndef TMDLY_BIT6
#define TMDLY_BIT6
#define UART4RXCTRBIT			0x040
#define UART4RXCTRTM			Timer3Ctr.time[6]
#define SETUART4RXDLY()		{TIM_ITConfig(TIM3,TIM_IT_Update,DISABLE);\
														Timer3Ctr.devbit |= UART4RXCTRBIT;\
														UART4RXCTRTM = (u32)UART4_RX_INTERVAL;\
														TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE);\
													}
#define RESETUART4RXDLY()	{DISABLE_INT();\
													Timer3Ctr.devbit &= ~UART4RXCTRBIT;\
													UART4RXCTRTM = 0;\
													ENABLE_INT();}
#else
#error TMDLY_BIT6 has been defined!
#endif	//TMDLY_BIT6


#ifndef TMDLY_BIT7
#define TMDLY_BIT7
#define UART4TXCTRBIT			0x080
#define UART4TXCTRTM			Timer3Ctr.time[7]
#define SETUART4TXDLY()		{TIM_ITConfig(TIM3,TIM_IT_Update,DISABLE);\
														Timer3Ctr.devbit |= UART4TXCTRBIT;\
														UART4TXCTRTM = (u32)UART4_TX_INTERVAL;\
														TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE);\
													}
#define RESETUART4TXDLY()	{DISABLE_INT();\
													Timer3Ctr.devbit &= ~UART4TXCTRBIT;\
													UART4TXCTRTM = 0;\
													ENABLE_INT();}
#else
#error TMDLY_BIT7 has been defined!
#endif	//TMDLY_BIT7




extern UARTSTRUCT MyUart4;
extern SemaphoreHandle_t  Binary_Uart4;
void Uart4_Init(u32 bound);






static void Uart4_TxDMAConfig(void);
static void Uart4TXDMAStart(u8 *senddata,u16 datalen);
static void Uart4_PutC(u8 udata);
static void Uart4_PutStrlen(u8 *senddata,u16 datalen);
static void Uart4_Printf(char* fmt,...) ;
static u8 Uart4_GetOneRxPkg(UART_RXINFO *pkginfo,u32 timetowait_ms);
static void Uart4_ReleaseOneRxPkg(UART_RXINFO *pkginfo);
static void Uart4_Var_Init(void);
static void Uart4_SendBeforCallBack(void);
static void Uart4_SendOverCallBack(void);
static void Uart4_StoreOneRxPkg(void);
static u8 Uart4_GetOneRxPkg(UART_RXINFO *pkginfo,u32 timetowait_ms);
static void Uart4_ReleaseOneRxPkg(UART_RXINFO *pkginfo);
static void Uart4_ReleaseAllRxPkg(void);
#endif

#endif

